//
//  ShopCarCell.m
//  ShopCarDelete
//
//  Created by xhl on 16/7/7.
//  Copyright © 2016年 xhl. All rights reserved.
//

#import "ShopCarCell.h"
#import "CellModel.h"

@interface ShopCarCell ()
@property (weak, nonatomic) IBOutlet UILabel *contentLbl;
@property (weak, nonatomic) IBOutlet UIButton *deleteBt;
//@property (strong, nonatomic) CellModel *cellModel;

@end

@implementation ShopCarCell

+(instancetype)backCell:(UITableView*)tableview
{
    static NSString *cellIdentifier = @"cellId";
    ShopCarCell *cell = [tableview dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"ShopCarCell" owner:nil options:nil] lastObject];
    }
    
    return cell;
}




- (IBAction)deleteClick:(UIButton*)sender {
    
    if (self.callBack) {
        self.callBack(sender.tag);
    }
}

- (void)cellDataWithModel:(CellModel*)model andIndexPath:(NSIndexPath*)indexPath
{
    self.contentLbl.text = model.content;
    self.deleteBt.tag = indexPath.row;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
